<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{:sysconfig('site','site_name')}</title>
    {include file='common/_require'/}
    <script>
        window.uploadAddressPrefix = '/index/'
    </script>
</head>

<body>
    <div class="ul-header ">
        <div class="ul-header-main" style="width: 95%;">

            <div class="ul-header-left">
                <a href="/" class="" style="font-size:18px;">
                    {:sysconfig('site','site_name')}
                </a>
                <span>{:sysconfig('site','site_desc')}</span>
            </div>
            <div class="ul-header-right">
                <div class="ul-header-user">
                    {empty name='$user'}
                    <div class="ul-header-user-avatar">

                    </div>
                    <a href="{:url('Index/login',['backurl'=>$Request.url])}">立即登录</a>
                    {else /}

                    <div class="ul-header-user-avatar" style="background-image: url('{$user.avatar_src}');">

                    </div>
                    <div class="ul-header-user-info">
                        <div class="ul-header-user-name">
                            {$user.nickname}
                        </div>
                        <div class="ul-header-user-options do-logout">
                            <i class="ul-icon-exit"></i>
                            <span>退出</span>
                        </div>
                    </div>
                    {/empty}
                </div>
            </div>
        </div>

    </div>

    <div class="layui-container">
        <div class="layui-row ul-section " style="margin-top: 15px;">
            {__CONTENT__}
        </div>
        <div class="layui-row ul-section ">
            <div class="footer ul-padding-md ul-bg-white">
                <span>{:sysconfig('site','site_copyright')}</span>
                <a href="http://www.beian.miit.gov.cn/">{:sysconfig('site','site_beian')}</a>
                <a href="{:sysconfig('site','site_safe_beian_url')}">{:sysconfig('site','site_safe_beian')}</a>
            </div>
        </div>
    </div>

    <script>
        $('.do-logout').click(function () {
            layer.confirm('确定要退出吗?', function () {
                $.upost('{:url("Index/logout")}', function () {
                    layer.msg('退出成功');

                    setTimeout(() => {
                        location.reload()
                    }, 1200);
                })
            })
        })
    </script>

</body>

</html>